package com.bbs.service.impl;

import com.bbs.map.adminMapper;
import com.bbs.pojo.Admin;
import com.bbs.service.adminService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class adminIMPL implements adminService {
    @Autowired
    adminMapper admin;

    @Override
    public Admin login(String name) {
        if (admin.findAdminByUsernameAndPassword(name) != null)
            return admin.findAdminByUsernameAndPassword(name);
        else
            return null;
    }

    @Override
    public boolean registerAdmin() {
        if (admin.addAdmin() > 0)
            return true;
        else
            return false;
    }
}
